import FieldProps, {type IFieldProps} from '../../basic/FieldProps'

export interface INumberProps extends IFieldProps{
  min?: number|undefined,
  max?: number|undefined,
}
export default class NumberProps extends FieldProps implements INumberProps{
  public min = undefined;
  public max = undefined;

  constructor(props?:INumberProps) {
    super({
      widgetLabel: "数字输入",
      widgetType:"NUMBER",
      ...(props||{})
    });
    if(props){
      this.min = !isNaN(props.min as any)?props.min:this.min as any;
      this.max = !isNaN(props.max as any)?props.max:this.max as any;
    }
  }
}
